package com.eascs.tdriskcloud.controller;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

import org.apache.poi.ss.formula.functions.T;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.eascs.site.controller.BaseRestController;
import com.eascs.site.view.BaseRestResult;
import com.eascs.tdriskcloud.form.BaseInfoForm;
import com.eascs.tdriskcloud.service.CallTDService;
import com.eascs.tdriskcloud.service.HitInfoParsService;
import com.eascs.tdriskcloud.service.TDRiskCloudService;

@Controller
@RequestMapping(value = "/td")
public class TDRestController extends BaseRestController {

	@Inject
	TDRiskCloudService tdService;
	
	@Inject
	HitInfoParsService hitService;
	
	@Inject
	CallTDService callService;
	
	@RequestMapping(value = "/testParsHits")
	public BaseRestResult testParsHits(){
		List<List<T>> testData = new ArrayList<>();
		testData = callService.parsHistDataInterface("leaqlv4t6fqol"); 
		System.out.println("调试");
		return null;
	}
	
	@RequestMapping(value = "/testAPI")
	public BaseRestResult testAPI(){
		BaseInfoForm entity = new BaseInfoForm();
		entity.setAccountMobile("15961718173");
		entity.setAccountName("皮晴晴");
		entity.setBillCode("测试billcode");
		entity.setIdNumber("370404199006301915");
		String tdId = callService.saveTDApiInterface(entity);
		String id = tdId;
		return null;
	}
	
	@RequestMapping(value = "/testSaveHits")
	public BaseRestResult testSaveHits(){
		String  tdId = "leruqhn4li22d";
		callService.saveHitsInfoInterface(tdId);
		return null;
	}
}
